<?php

namespace App\Consts;

/**
 * 全局通用常量定义
 * @author dumpling
 */
class GlobalConst
{
    public const DEFAULT_TARGET_DETAIL_TYPE = 1;

    // 1文章，2笔记，3评论，4恢复，5动态，6收藏夹
    public const TARGET_TYPE_ARTICLE = 1;
    public const TARGET_TYPE_NOTE = 2;
    public const TARGET_TYPE_COMMENT = 3;
    public const TARGET_TYPE_REPLY = 4;
    public const TARGET_TYPE_DYNAMIC = 5;
    public const TARGET_TYPE_FAVORITES = 6;
    public const TARGET_TYPE_TOPIC = 7;

    public const NEW_TARGET_TYPE_QUICK_RECOMMEND_ARTICLE = 1;
    public const NEW_TARGET_TYPE_ORIGINAL_ARTICLE = 2;
    public const NEW_TARGET_TYPE_LINE_NOTE = 3;
    public const NEW_TARGET_TYPE_ARTICLE_NOTE = 4;
    public const NEW_TARGET_TYPE_ESSAY_NOTE = 5;

    public const NOTE_TYPE_MAP = [
        GlobalNoteConst::TYPE_ARTICLE_NOTE => self::NEW_TARGET_TYPE_ARTICLE_NOTE,
        GlobalNoteConst::TYPE_LINE_NOTE => self::NEW_TARGET_TYPE_LINE_NOTE,
        GlobalNoteConst::TYPE_ESSAY_NOTE => self::NEW_TARGET_TYPE_ESSAY_NOTE
    ];

    // 数据库分表数量
    public const DATABASE_TABLE_NUM = 4;
    // 数据库分表索引
    public const DATABASE_TABLE_INDEX = [0, 1, 2, 3];

    //每页返回数量
    public const BASE_PAGE_COUNT = 20;
    public const PAGE_COUNT_FIVE = 5;
    public const PAGE_COUNT_EIGHT = 8;

    // 排序规则
    public const ORDER_TYPE_DESC = 'desc';
    public const ORDER_TYPE_ASC = 'asc';

    // 是否删除，0正常，1删除
    public const IS_NOT_DELETE = 0;
    public const IS_DELETED = 1;

    // 是否屏蔽，0否，1是
    public const IS_NOT_SHIELD = 0;
    public const IS_SHIELD = 1;

    // 登录端：1Web端，2小程序，3iOS，4安卓
    public const LOGIN_PLATFORM_WEB = 1;
    public const LOGIN_PLATFORM_APPLET = 2;
    public const LOGIN_PLATFORM_IOS = 3;
    public const LOGIN_PLATFORM_ANDROID = 4;

    // 执行命令绝对位置
    public const EXEC_PHP = '/usr/local/bin/php ';
    public const EXEC_PYTHON = 'PYTHONIOENCODING=utf-8 /usr/bin/python3 ';

    public const DEFAULT_AVATAR = 'default.png';
}
